package com.ly.web.admin.service.demo.service.impl;


import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ly.common.base.page.PageList;
import com.ly.common.base.service.impl.BaseServiceImpl;
import com.ly.common.cache.IEhcacheService;
import com.ly.web.admin.service.demo.domain.DemoDomain;
import com.ly.web.admin.service.demo.mapper.DemoMapper;
import com.ly.web.admin.service.demo.repository.DemoRepository;
import com.ly.web.admin.service.demo.service.IDemoService;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 父字典的业务实现类
 * @author : lzw
 * @since : 2018年04月27日
 * @version : v0.0.1
 */
@SuppressWarnings("SpringJavaAutowiringInspection")
@Service("demoService")
public class DemoServiceImpl extends BaseServiceImpl<DemoDomain> implements IDemoService<DemoDomain> {

    @Autowired
    private DemoRepository demoRepository;

    @Autowired
    private DemoMapper demoMapper;

    @Autowired
    private CacheManager cacheManager;

    @Autowired
    private IEhcacheService ehcacheService;




    @Override
    public List<DemoDomain> selectTest() {

     /*   int pageIndex=1;
        int pageSize=5;
        //PageHelper分页 使用分页插件,就这一行
        Page page= PageHelper.startPage(1, 5);
        List<DemoDomain> list=demoMapper.selectTest();
        PageList<DemoDomain> pageList = new PageList<>(list, pageIndex, pageSize,page.getPageNum(), page.getTotal());*/
        return  demoMapper.selectTest();
    }
}
